package com.ronghuanet.car;

import com.ronghuanet.BaseTest;
import com.ronghuanet.car.domain.Car;
import com.ronghuanet.car.domain.CarDetail;
import com.ronghuanet.car.domain.CarType;
import com.ronghuanet.car.service.ICarDetailService;
import com.ronghuanet.car.service.ICarService;
import com.ronghuanet.car.service.ICarTypeService;
import com.ronghuanet.org.service.IShopService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class Cartest extends BaseTest {
    @Autowired
    private ICarService carService;

    @Autowired
    private ICarTypeService carTypeService;

    @Autowired
    private ICarDetailService carDetailService;

    @Autowired
    private IShopService shopService;

    @Test
    public void test() throws  Exception{
        Car car = carService.getById(285L);
        for (int i = 0; i < 100; i++) {
            car.setId(null);
            car.setTitle("宝马2020 x3贱卖-->edit"+i);

            CarDetail detail = new CarDetail();
            detail.setInfo("<p><img src=\"http://115.159.217.249:8888/group1/M00/00/03/rBEAA2MasiSAef1xAAHt5Ab1hek432.jpg\"></p>");
            car.setCarDetail(detail);

            CarType carType = new CarType();
            carType.setId(27L);
            car.setCarType(carType);

            carService.add(car);
        }


    }
}
